<template>
  <div>
    <h2>HomeIndex</h2>

    {{ $store.state.count }}
    <input type="text" v-model="count">
    <hr>
    <button @click="$store.state.count++">$route.state.count++</button>
    <hr>
    <button @click="$store.commit('SET_COUNT', 1)">$store.commit('SET_COUNT', 1)</button>
  </div>
</template>

<script>
export default {
  computed: {
    count: {
      get() {
        return this.$store.state.count;
      },
      set(value) {
        this.$store.commit('SET_COUNT', value);
      }
    }
  }

};
</script>